clear, close, clc

L = 100;
H = 100;
u = zeros(L,H);
[X,Y] = meshgrid(1:1:L, 1:1:H);

BC = ones(size(H,1));

for k=1:100
    Ak = (2/(H*sinh(k*pi*L/H))) * sum(BC .* sin(k*pi/H*(1:H)));
    u = u + Ak*sin(k*pi/H*Y)*sinh(k*pi/H*X);
end
imagesc(u);
colorbar;